#include "functions.h"

int main()
{
  int n = 84;
  double** A = new double*[n];
  for(int i = 0; i < n; i++)
    {
      A[i] = new double[n]();
    }
  A[0][0] = 6.0;
  A[0][1] = 1.0;
  for(int i = 1; i < 83; i++)
    {
      A[i][i-1] = 8.0;
      A[i][i] = 6.0;
      A[i][i+1] = 1.0;
    }
  A[83][82] = 8.0;
  A[83][83] = 6.0;
  double* b = new double[84];
  b[0] = 7.0;
  b[83] = 14.0;
  for(int i = 1; i < 83; i++)
    b[i] = 15.0;
  Gaussian_Elimination(A, n);
  Unit_Lower_Triangular_Matrix(A, b, n);
  Upper_Triangular_Matrix(A, b, n);
  std::cout << " Answer of Gauss-Elimination:" << std::endl;
  for(int i = 0; i < n; i++)
    {
      std::cout << "x(" << i+1 << ")=" << b[i] << std::endl;
    }
  for(int i = 0; i < n; i++)
    {
      delete[] A[i];
    }
  delete [] A;
  delete [] b;

  return 0;
};
